//
//  GlobalMacro.h
//  公安局项目
//
//  Created by 镇景雄 on 16/3/17.
//  Copyright © 2016年 aiweifeihong. All rights reserved.
//

#ifndef GlobalMacro_h
#define GlobalMacro_h
/**
 *  HUD自动隐藏
 *
 */
#define HUDNormal2(msg) {MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:[[UIApplication sharedApplication].delegate window] animated:NO];\
hud.mode = MBProgressHUDModeText;\
hud.minShowTime=3;\
hud.detailsLabelText= msg;\
hud.detailsLabelFont = [UIFont systemFontOfSize:17];\
[hud hide:YES afterDelay:1];\
}

/**
 *  HUD自动隐藏
 *
 */
#define HUDNormal(msg) {MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:[[UIApplication sharedApplication].delegate window] animated:NO];\
hud.mode = MBProgressHUDModeText;\
hud.minShowTime=1;\
hud.detailsLabel.text= msg;\
hud.detailsLabel.font = [UIFont systemFontOfSize:17];\
[hud hideAnimated:YES afterDelay:1];\
}

#define HUDNormal5(msg) {MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:[[UIApplication sharedApplication].delegate window] animated:NO];\
hud.mode = MBProgressHUDModeText;\
hud.minShowTime=5;\
hud.detailsLabel.text= msg;\
hud.detailsLabel.font = [UIFont systemFontOfSize:17];\
[hud hideAnimated:YES afterDelay:1];\
}

/**
 *  HUD不自动隐藏
 *
 */
#define HUDNoStop(msg)    {MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:NO];\
hud.minShowTime=0.4;\
 hud.square = YES;\
hud.detailsLabel.text = msg;\
hud.detailsLabel.font = [UIFont systemFontOfSize:17];\
hud.bezelView.color =[[UIColor blackColor] colorWithAlphaComponent:0.9];\
hud.contentColor = [UIColor whiteColor];\
hud.mode = MBProgressHUDModeIndeterminate;}

/**
 *  HUD不自动隐藏最小时间为0
 *
 */
#define HUDNoStop1(msg)    {MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:NO];\
hud.detailsLabel.text= msg;\
hud.detailsLabel.font = [UIFont systemFontOfSize:17];\
hud.bezelView.color =[[UIColor blackColor] colorWithAlphaComponent:0.9];\
hud.contentColor = [UIColor whiteColor];\
hud.mode = MBProgressHUDModeIndeterminate;}

/**
 *  HUD隐藏
 *
 */
#define HUDStop [MBProgressHUD hideHUDForView:[[(CustonNavigaionController *)[(RootViewController *)[UIApplication sharedApplication].keyWindow.rootViewController selectedViewController] topViewController] view] animated:NO];
//#define HUDStop [MBProgressHUD hideHUDForView:self.view animated:NO];


//获取设备的物理高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
//获取设备的物理宽度
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
//获取本地属性列表对象
#define UserDefault [NSUserDefaults standardUserDefaults]
//设置图片
#define setImage(ImageView,urlstr)   [ImageView sd_setImageWithURL:[NSURL URLWithString:urlstr] placeholderImage:[UIImage imageNamed:@"dynamicDefut"]];
#define setImageviewWithImage(ImageView,urlstr,image)   [ImageView sd_setImageWithURL:[NSURL URLWithString:urlstr] placeholderImage:image];
#define setButton(Button,urlstr) [Button sd_setImageWithURL:[NSURL URLWithString:urlstr] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"placeholder"]];
//设置颜色
#define CREAT_COLOR(R,G,B,ALPHA) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:ALPHA]
#define ZZRGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
//判断请求成功的状态
#define requestIsSuccessful [responseDic[@"ErrorCode"] integerValue]==1
//字体适配
#define LabelFount(I) [UIFont systemFontOfSize:(ScreenWidth/375*I)]
//self
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
//宽度比
#define scaleOfWidth ScreenWidth/375

//当前版本
#define  App_Version  [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
//当前APP跳转链接
#define App_jumpURL @"http://itunes.apple.com/gb/app/yi-dong-cai-bian/id1185821452?mt=8"
//缓存首页的数据
#define HomePageData @"HomePageData"
//缓存发现模块的数据
#define FindListData @"FindListData"
//推荐标的数据
#define RecommendMarkData @"RecommendMarkData"
//个人中心首页数据
#define PersonalCenterData @"PersonalCenterData"
//车辆直租首页数据
#define RentListData @"RentListData"
//以租代购首页数据
#define PurchasingListData @"PurchasingListData"
//权益转让数据
#define EquityTransferData @"EquityTransferData"

//屏幕尺寸

#define IPHONE4 (([UIScreen mainScreen].bounds.size.width == 320) && ([UIScreen mainScreen].bounds.size.height == 480))

#define IPHONE5 (([UIScreen mainScreen].bounds.size.width == 320) && ([UIScreen mainScreen].bounds.size.height == 568))

#define IPHONE6 (([UIScreen mainScreen].bounds.size.width == 375) && ([UIScreen mainScreen].bounds.size.height == 667))

#define IPHONE6P (([UIScreen mainScreen].bounds.size.width == 414) && ([UIScreen mainScreen].bounds.size.height == 736))



#endif /* GlobalMacro_h */
